package com.mtjx.controller;

import com.mtjx.entitys.dto.LoginDTO;
import com.mtjx.resp.VfResult;
import com.mtjx.service.LoginService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 33117
 * @version 1.0
 * @data 2025/8/19 17:03
 */
@RestController
@RequestMapping("/api/auth")
public class ILoginWeb {
    @Resource
    private LoginService loginService;

    /**
     * 登录
     *
     * @param loginDTO
     * @return
     */
    @ApiOperation(value = "登录", notes = "登录", produces = "application/json")
    @ApiResponses({@ApiResponse(code = 200, message = "登录成功")})
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    VfResult login(@RequestBody LoginDTO loginDTO){
        VfResult login = loginService.login(loginDTO);
        return login;
    };

}
